home *** CD-ROM | disk | FTP | other *** search
-
- #include <stdarg.h>
- #include <string.h>
- #include "xcmd.h"
-
- /* Copies supplied parameters (each comes in as a string
- * to the supplied parameter block and sets the number of
- * parameters field approriately. Note that this routine
- * can handle a variable number of arguments. It uses the
- * macros (in stdarg.h) supplied with Think C to manage
- * the variable number of arguments correctly. The last
- * argument must be a null string ("").
- */
-
- #ifdef XTEST
-
- void xpars(XCmdBlock *pb,...)
- {
- va_list xp;
- char *s;
- short i;
-
- va_start(xp,pb);
- s = va_arg(xp,char *);
- i = 0;
- while (*s && i <= 15) /* can have a maximum of 16 arguments */
- {
- strcpy(*(pb->params[i]),s);
- i++;
- s = va_arg(xp,char *);
- }
- pb->paramCount = i;
- va_end(xp);
- }
- #endif
-
-
-